// import request from 'umi-request';
import request from '@/utils/request';
export async function queryRule(params) {
    const limit = params.pageSize;
    const page = params.current;
    const my_params = {
        limit: limit,
        page: page,
    };
    Object.assign(params, my_params);
    return request('/factory/terminal/device/log/page', {
        params,
    });
}

export async function removeRule(payload) {
    return request(`/factory/terminal/device/log/${payload}`, {
        method: 'DELETE',
    });
}
export async function addRule(params) {
    return request('/api/rule', {
        method: 'POST',
        data: {
            ...params,
            method: 'post'
        },
    });
}
export async function updateRule(params) {
    return request('/api/rule', {
        method: 'POST',
        data: {
            ...params,
            method: 'update'
        },
    });
}